import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useDurationStore = defineStore('duration', () => {
    // 定义状态的内容
    // 响应式变量
    const duration = ref('');

    // 修改
    const setDuration = (newDuration) => {
        duration.value = newDuration;
    }

    // 移除
    const removeDuration = () => {
        duration.value = ''; // 修正变量名错误
    }

    return {
        duration,
        setDuration,
        removeDuration
    }
}, {
    persist: true // 持久化存储
})